package com.tc.zigbee.mt.income;

import java.util.LinkedList;
import java.util.List;

import com.tc.util.DataUtil;


public class ActiveEndpointResponse extends IncomeMessage {
	public short getSrcAddress() {
		return srcAddress;
	}
	public List<Byte> getEndpoints() {
		return endpoints;
	}
	public ActiveEndpointResponse(byte[] data){
	byte[] na = new byte[2];
	na[0] = data[0];
	na[1] = data[1];
	srcAddress = DataUtil.shortValue(na);
	status = data[2];
	na[0] = data[3];
	na[1] = data[4];

	
	nwkAddress = DataUtil.shortValue(na);
	
	activeEPCount = data[5];
	
	for(int i = 0; i < activeEPCount; i++){
		
		endpoints.add(data[6 + i]);
		
	}
	
}

//Length = 0x06-0x53  Cmd0 = 0x45  Cmd1 = 0x85  SrcAddr  Status  NwkAddr  ActiveEPCount ActiveEPList  
byte status;

short nwkAddress;
short srcAddress;
byte activeEPCount;
List<Byte> endpoints = new LinkedList<Byte>();

public byte getStatus() {
	return status;
}
public short getNwkAddress() {
	return nwkAddress;
}


}
